package com.zengqingfa.designpattern.behavior.chain.stock;

/**
 * @author zengqingfa
 * @className Test
 * @description
 * @create 2023/1/14 21:58
 */
public class Test {

    public static void main(String[] args) {
        AbstractHandler handler01 = new JudgeHandler();
        // 创建请求并提交到指责链中进行处理
        AbstractJudgment request01 = new JudgmentOne("被判断的内容1");
        AbstractJudgment request02 = new JudgmentTwo("被判断的内容2");
        AbstractJudgment request03 = new JudgmentThree("被判断的内容3");
        // 进行链的组装，即头尾相连，一层套一层
        request01.setNextJudg(request02);
        request02.setNextJudg(request03);
        // 每次提交都是从链头开始遍历
        handler01.handleJudgment(request01);
    }

}